package com.app.repository.impl;

import com.app.model.main.Image;
import com.app.repository.interfaces.ImageMapper;
import com.app.support.dao.MybatisDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by Lichaojie on 2017/3/11. It's a beautiful day.
 */
@Repository
public class ImageMapperImpl implements ImageMapper {

    @Autowired
    private MybatisDao mybatisDao;

    @Override
    public int deleteByPrimaryKey(Long id){
        return mybatisDao.delete("com.app.dao.main.ImageMapper",".deletePrimaryKey",id);
    }

    @Override
    public int insert(Image record){
        return mybatisDao.insert("com.app.dao.main.ImageMapper",".insert",record);
    }

    @Override
    public int insertSelective(Image record){
        return mybatisDao.insert("com.app.dao.main.ImageMapper",".insertSelective",record);
    }

    @Override
    public Image selectByPrimaryKey(Long id){
        return mybatisDao.get("com.app.dao.main.ImageMapper",".selectByPrimaryKey",id);
    }

    @Override
    public int updateByPrimaryKeySelective(Image record){
        return mybatisDao.update("com.app.dao.main.ImageMapper",".updateByPrimaryKeySelective",record);
    }

    @Override
    public int updateByPrimaryKey(Image record){
        return mybatisDao.update("com.app.dao.main.ImageMapper",".updateByPrimaryKey",record);
    }

    @Override
    public Image selectByImage(String origin){
        return mybatisDao.get("com.app.dao.main.ImageMapper",".selectByImage",origin);
    }
}
